<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%-- <%@include file="../../common/taglib/taglib.jsp"%> --%>

<div class="pageHeader">
	<form id="pagerForm" onsubmit="return navTabSearch(this);" action="${baseURL }/agent/agentList" method="post">
		<!-- 分页表单参数 -->
		<%@include file="../common/pageParameter.jsp"%>
		<div class="searchBar">
			<table class="searchContent">
				<tr>
					<td>
						<label>一级代理商编号：</label>
						<input type="text" name="agent.userNo" size="25" maxlength="128" class="readonly" value="${agentNo }" />
						<a style="float: right;" class="btnLook" href="${baseURL}/user/info/lookupList?userType=AGENT" lookupGroup="agent">选择代理商</a>
					</td>
					<td>
						<label>状态：</label>
						<select name="status">
							<option value="">全部</option>
							<c:forEach items="${merchantStatusEnumsList }" var="model">

								<option value="${model.name }" <c:if test="${model.name eq param.status }">selected="selected"</c:if>>${model.desc }</option>
							</c:forEach>
						</select>
					</td>
					<td>
						<label>创建时间：</label>
						<input type="text" name="beginDate" id="beginDate" value="${param.beginDate}" class="date" size="10" readonly="readonly" />
						-
						<input type="text" name="endDate" value="${param.endDate}" id="endDate" class="date" size="10" readonly="readonly" />
					</td>
					<td>
						<div class="subBar" style="float: left;">
							<ul>
								<li>
									<div class="buttonActive">
										<div class="buttonContent">
											<z:permission value="agent:manager:list">
												<button type="submit">查询</button>
											</z:permission>
										</div>
									</div>
								</li>
							</ul>
						</div>
					</td>
				</tr>
			</table>
		</div>
	</form>
</div>
<div class="pageContent">
	<table class="table" targetType="navTab" asc="asc" desc="desc" nowrapTD="false" width="100%" layoutH="115">
		<thead>
			<tr>
				<th>序号</th>
				<th>创建时间</th>
				<th>代理商编号</th>
				<th>代理商名称</th>
				<th>代理商层级关系</th>
				<th>状态</th>
				<th>操作</th>
			</tr>
		</thead>
		<tbody>
			<c:forEach var="item" items="${pageBean.recordList}" varStatus="st">
				<tr target="sid_user" rel="${item.id}">
					<td>${st.index+1 }</td>
					<td>
						<fmt:formatDate value="${item.createTime }" pattern="yyyy-MM-dd HH:mm:ss" />
					</td>
					<td>${item.agentNo }</td>
					<td>${item.agentName}</td>
					<td>
						<!-- 如果代理商级别是一级： -->
						<c:if test="${item.level eq 2 }">
						 	${item.parentAgentName }-[${item.parentAgentNo }]
						 	<br />&nbsp;&nbsp;∟${item.agentName }-[${item.agentNo }]
						</c:if>
						<c:if test="${item.level eq 3 }">
							${item.parentUpAgentName }-[${item.parentUpAgentNo }]
							<br />&nbsp;&nbsp;∟${item.parentAgentName }-[${item.parentAgentNo }]
							<br />&nbsp;&nbsp;&nbsp;&nbsp;∟${item.agentName }-[${item.agentNo }]
						</c:if>
					</td>
					<td>
						<c:forEach items="${merchantStatusEnumsList }" var="mStatus">
							<c:if test="${mStatus.name eq item.status }">
								<font color="red">${mStatus.desc}</font>
							</c:if>
						</c:forEach>
					</td>
					<td width="150"></td>
				</tr>
			</c:forEach>
		</tbody>
	</table>
	<!-- 分页条 -->
	<%@include file="../common/pageBar.jsp"%>
</div>